﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using ARS.PublicTool.DataHandle;

namespace ARS.Control.Custom.Entity.Attributes
{
    public class WhereField
    {
        public string FieldName
        {
            get;
            set;
        }

        public string Value
        {
            get;
            set;
        }

        public string RequestKey
        {
            set
            {
                this.Value = HttpContext.Current.Request.QueryString[value] ??
                             HttpContext.Current.Request.Form[value];
                if (string.IsNullOrEmpty(this.Value))
                {
                    HttpContext.Current.Response.Write("没有传入" + value + "值");
                    HttpContext.Current.Response.End();
                }
                if (this.IsEncryptKey)
                {
                    this.Value = Encrypt.DecryptString(this.Value);
                }
            }
        }
        /// <summary>
        /// 加密key
        /// </summary>
        public bool IsEncryptKey
        {
            set;
            get;
        }
    }
}
